package com.cloudlead.plugin.security.vo;

import com.cloudlead.common.lang.persistence.AbstractIdEntity;

import com.cloudlead.plugin.security.action.validator.ScPrivilegeValidatorGroup.*;

import javax.validation.constraints.Size;
import com.cloudlead.plugin.security.vo.ScResource;
import com.cloudlead.common.lang.annotation.BelongsTos;
import com.cloudlead.common.lang.annotation.Domain;
import java.lang.Boolean;
import com.cloudlead.common.lang.annotation.Label;
import java.lang.String;
import javax.validation.constraints.NotNull;
import java.lang.Integer;

/**
 * ScPrivilege is a Codegen vo type
 */
@Label("权限")
@BelongsTos(values = {
	@com.cloudlead.common.lang.annotation.BelongsTo(property="scResource", rootField="scResourceId")
})
@Domain(domainClassName="com.cloudlead.plugin.security.entity.EScPrivilege")
public class ScPrivilege extends AbstractIdEntity<String> {

    private static final long serialVersionUID =7376375129766L;    
    @NotNull(groups={Create.class,Update.class})
    @Label("是否有效")
    private Boolean available;

    @Label("权限类型")
    @Size(max=5)
    private String category;

    @Label("categorys")
    private Integer categorys;

    @Label("描述")
    @Size(max=255)
    private String description;

    @NotNull(groups={Update.class})
    @Label("编号")
    @Size(max=24)
    private String id;

    @NotNull(groups={Create.class,Update.class})
    @Label("名称")
    @Size(max=100)
    private String name;

    @Label("上级编号")
    @Size(max=24)
    private String pid;

    @Label("所属资源")
    private ScResource scResource;

    public Boolean getAvailable() {
        return available;
    }

    public void setAvailable(Boolean available) {
        this.available = available;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public Integer getCategorys() {
        return categorys;
    }

    public void setCategorys(Integer categorys) {
        this.categorys = categorys;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public ScResource getScResource() {
        return scResource;
    }

    public void setScResource(ScResource scResource) {
        this.scResource = scResource;
    }

    public String toString() {
         return String.format("ScPrivilege { available : %s,category : %s,categorys : %s,description : %s,id : %s,name : %s,pid : %s,scResource : %s }",available,category,categorys,description,id,name,pid,scResource);
    }

}

